package com.dimples.security.captcha;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import lombok.RequiredArgsConstructor;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2021/6/24
 */
@Controller
@RequiredArgsConstructor
public class CaptchaController {

    private final ImageCodeHelper imageCodeHelper;

    @GetMapping("/images/captcha")
    public void captcha(HttpServletRequest request, HttpServletResponse response) throws Exception {
        imageCodeHelper.createCaptcha(request, response);
    }
}
